//
//  WeatherView.m
//  XhlTrip
//
//  Created by dlios on 15/9/28.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "WeatherView.h"

@implementation WeatherView
-(void)dealloc
{
    
    
    [self.areabutton release];
    [self.high release];
    [self.low release];
    [self.time release];
    [self.date release];
    [super dealloc];
    
}
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.areabutton = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.areabutton addTarget:self action:@selector(gotoChooseCity:) forControlEvents:UIControlEventTouchUpInside];
        [self.areabutton setTitle:@"香港" forState:UIControlStateNormal];
        [self.areabutton setTintColor:[UIColor whiteColor]];
        [self addSubview:_areabutton];
        
        
        
        self.high = [[UILabel alloc]init];
        self.high.text  = @"25";
        self.high.textColor = [UIColor whiteColor];
        self.high.font = [UIFont systemFontOfSize:50];
        [self addSubview:_high];
        
        self.low = [[UILabel alloc]init];
        self.low.text = @"22";
        self.low.textColor = [UIColor whiteColor];
        self.low.font = [UIFont systemFontOfSize:50];
        [self addSubview:_low];
        
        self.time = [[UILabel alloc]init];
        self.time.textColor = [UIColor whiteColor];
        self.time.text = @"当地时间";
        self.time.font = [UIFont boldSystemFontOfSize:15];
        [self addSubview:_time];
        
        
        self.date = [[UILabel alloc]init];
        [self addSubview:_date];
        
    }
    
    return self;
}
- (void)layoutSubviews{
    
    self.areabutton.frame = CGRectMake(self.frame.size.width / 2 - 25, 50, 50, 30);
    self.low.frame = CGRectMake(80, 70, 100, 100);
    self.high.frame = CGRectMake(230, 70, 100, 100);
    self.time.frame = CGRectMake(10, 270, 70, 30);
    self.date.frame = CGRectMake(130, 200, 70, 30);
    
}
- (void)gotoChooseCity:(UIButton *)button
{
    [self.delegate gotoChooseViewController];
}

@end
